<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>	
<!DOCTYPE html PUBLIC>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/board.css" />
<title>Insert title here</title>
</head>
<body>
<div id='boardFrm' align="center">
<!-- 상단 타이틀 이미지 -->
	<div align="left" style = "margin-bottom: 20px; margin-top: 20px">
		<img src = "images/board/notice_tt.gif"/>
	</div>
	
	<!-- 페이지 표시 -->
	<div style="text-align: right; font-family: 맑은 고딕; 
	font-size: 12px; color:#BDBDBD; margin-bottom: 10px;">
	페이지 : ${page}&nbsp; of &nbsp;${totalPage}
	</div>
	
		<!-- 게시판 타이틀 -->
		<div class = 'board_title'>
			<span style="width: 5%;">NO</span>
			<span style="width: 60%;">제목</span>
			<span style="width: 20%;">작성일</span>
			<span style="width: 10%;">조회수</span>
		</div>
		
		<c:if test="${cnt == 0}">
		<div>
			<span style="width: 95%;">등록된 게시글이 없습니다.</span>
		</div>
	    </c:if>
		
		<!-- 게시글 -->
		<c:if test="${cnt > 0}">
	    <c:forEach var="board" items="${noticeBoards}">
		<div class = 'list_frm'>
			<span style="width: 5%;">${board.idx}</span>
			<a href = "notice_detail.do?idx=${board.idx}"><span style="width: 60%;">${board.title}</span></a>
			<span style="width: 20%;"><fmt:formatDate value="${board.wdate}" pattern="yyyy-MM-dd" /></span>
			<span style="width: 10%;">${board.read_count}</span>
		</div>
		</c:forEach>
	</c:if>
</div>

	<!-- 페이지 링크 생성 부분 -->
	<div align="center" id = "paging_num" style = "margin-bottom: 40px;">
	   <ul>
					<c:if test="${totCnt > 10}">
						<c:forEach begin="${startPage}" end="${endPage}"  var="cur">
							<c:if test="${page == cur}">
							<li class="curPage">${cur}</li>
							</c:if>
							<c:if test="${page != cur}">
							<li><a href="notice.do?page=${cur}&keyword=${keyword}&field=${field}">${cur}</a></li>
							</c:if>
						</c:forEach>
					</c:if>
					<c:if test="${totCnt <= 10}">
					<li class="curPage">1</li>
					</c:if>
				</ul>
	</div>
</body>
</html>